<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('levels', function (Blueprint $table) {
            $table->id();
            $table->string('name')->comment('等级名');
            $table->string('icon')->comment('图标');
            $table->integer('score')->comment('升级所需借阅次数');
            $table->integer('borrow_num')->comment('限制本数');
            $table->integer('limit_day')->comment('限制天数');
            $table->integer('sort')->comment('排序');
            $table->timestamps();
        });

        DB::statement("alter table levels comment '用户级别'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('levels');
    }
};
